"""定义第三方应用用户(QQ--openid)与用户模型类User的关联关系"""
from django.db import models

from MeiduoMall.utils.models import BaseModel


class OAuthQQUser(BaseModel):
    """QQ登录用户数据"""
    user = models.ForeignKey("users.User", on_delete=models.CASCADE, verbose_name="用户")
    # db_index 如果为True,则该字段的数据库索引将会被创建,editable默认为True,若为False则不会在admin界面显示
    openid = models.CharField(max_length=64, verbose_name='openid', db_index=True)

    class Meta:
        db_table = 'tb_oauth_qq'
        verbose_name = 'QQ登录用户数据'
        verbose_name_plural = verbose_name
